1 diff -ur gtk+-3.2.2/modules/printbackends/cups.orig/gtkcupsutils.c gtk+-3.2.2/modules/printbackends/cups/gtkcupsutils.c
2 --- gtk+-3.2.2/modules/printbackends/cups.orig/gtkcupsutils.c 2011-11-07 19:47:37.000000000 +0100
3 +++ gtk+-3.2.2/modules/printbackends/cups/gtkcupsutils.c 2011-11-23 11:50:56.413671604 +0100
5 else if (request->type == GTK_CUPS_GET)
6 get_states[request->state] (request);
8 + if (gtk_cups_result_is_error (request->result)) {
9 + request->state = GTK_CUPS_REQUEST_DONE;
12 if (request->attempts > _GTK_CUPS_MAX_ATTEMPTS &&
13 request->state != GTK_CUPS_REQUEST_DONE)
16 * The callback sets cups_password to NULL to signal that the
17 * password has been used.
19 -static char *cups_password;
20 -static char *cups_username;
21 +static char *cups_password = NULL;
22 +static char *cups_username = NULL;
25 passwordCB (const char *prompt)
28 if (request->password_state == GTK_CUPS_PASSWORD_APPLIED)
30 + request->poll_state = GTK_CUPS_HTTP_IDLE;
31 request->password_state = GTK_CUPS_PASSWORD_NOT_VALID;
32 request->state = GTK_CUPS_POST_AUTH;
33 request->need_password = TRUE;
36 if (request->password_state == GTK_CUPS_PASSWORD_NONE)
38 - cups_password = g_strdup ("");
39 cups_username = request->username;
40 cupsSetPasswordCB (passwordCB);
43 /* move to AUTH state to let the backend
46 + request->poll_state = GTK_CUPS_HTTP_IDLE;
47 request->state = GTK_CUPS_POST_AUTH;
48 request->need_password = TRUE;
52 if (request->password_state == GTK_CUPS_PASSWORD_APPLIED)
54 + request->poll_state = GTK_CUPS_HTTP_IDLE;
55 request->password_state = GTK_CUPS_PASSWORD_NOT_VALID;
56 request->state = GTK_CUPS_GET_AUTH;
57 request->need_password = TRUE;
60 if (request->password_state == GTK_CUPS_PASSWORD_NONE)
62 - cups_password = g_strdup ("");
63 cups_username = request->username;
64 cupsSetPasswordCB (passwordCB);
67 /* move to AUTH state to let the backend
70 + request->poll_state = GTK_CUPS_HTTP_IDLE;
71 request->state = GTK_CUPS_GET_AUTH;
72 request->need_password = TRUE;
78 - request->state = GTK_CUPS_GET_SEND;
79 + request->state = GTK_CUPS_GET_CONNECT;
80 request->last_status = HTTP_CONTINUE;